home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1986 November & December
/
rerun-1986-11-12.d64
/
mag reader v7.2
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
6KB
|
225 lines
0 goto 100
1 rem mag reader v7.2
2 rem (c) 1986 david a. hook
3 :
9 rem display a screen
10 print "[147][146]";: open 2, 8, 2, f$
11 for i = fl to ll
12 print# 15, "p" + chr$(2) + chr$(i and 255) + chr$(i/256) + chr$(1)
13 sys ad
14 l=peek(142)
15 print left$(a$,l);
16 ifl<40 then print chr$(13);
17 poke 212, 0: next: close 2: return
18 :
100 if lk goto 600: rem after picture loads
110 poke 55, 0: poke 56, 32: clr
120 a$="abcdefghijklmnopqrst": a$=a$+a$
130 :
140 rem bkgd, char colors
150 read bb, ch
160 poke 53280, bb: poke 53281, bb: poke 646, ch
170 :
180 rem pic name, type, border color
190 read pf$, t$, kf
200 poke 2, 2 + 2*(t$="k") + (t$="d")
202 rem # extra pictures
203 read e
205 if e=0 goto 230
207 dim p(e), f$(e), t$(e), c(e)
208 for i=1 to e: read p(i), f$(i), t$(i), c(i)
209 if t$(i)="k" then f$(i)=chr$(129)+left$(f$(i)+" ",14)
211 if t$(i)="d" then f$(i)="dd"+f$(i)
212 next
214 ps=0: pl=0
220 rem issue file name
230 read f$
240 :
250 rem mag title, issue month
260 read mt$, mo$
270 :
280 cd$=""
290 sp$=" "
300 :
310 gosub 1000: rem help
320 :
330 lp=25: ad=896: ml=49152: if peek(ad)-160 then gosub 8000: rem read data
340 :
350 open 15, 8, 15, "i0"
360 :
370 rem get total line count
380 open 2, 8, 2, f$
390 sys ad
400 ln=val(a$)-1: pg=ln/lp
410 close 2
420 if ln<1 or pg<>int(pg) then print: print " file error": close 15: stop
430 :
440 rem skip the load if no hi-res picture included
450 lk=1: if peek(2)>1 then lk=2: goto 600
460 :
470 rem add special characters to picture file name
480 if t$="k" then pf$=chr$(129)+left$(pf$+" ",14)
490 if t$="d" then pf$="dd"+pf$
500 :
510 load pf$, 8, 1
520 :
530 end: rem never gets here
540 :
599 rem display picture
600 gosub 2000
601 gosub 2100
610 :
799 rem main loop
800 gosub 5000: rem screen prompt
810 gosub 3000: rem get fn key
820 goto 800
830 :
999 rem help screen
1000 print "[147]"; tab(14); "[200]elp [211]creen"
1010 print tab(14); "[163][163][163][163][163][163][163][163][163][163][163]"
1020 print " [217]ou may return here by pressing f2[146]."
1030 print " f1[146] -- [212]able of [195]ontents"
1040 print " f2[146] -- [212]his [200][197][204][208] [211]creen"
1050 print " f3[146] -- [199]o to a [211]creen (by its number)"
1060 print " f5[146] -- [208]revious [211]creen"
1070 print " f7[146] -- [206]ext [211]creen"
1080 print " f8[146] -- [209]uit [205]agazine"
1090 print " [212]hese programs were developed by:"
1100 print tab(13); "[196]avid [193]. [200]ook"
1110 print " for the [194][193][210][210][201][197] [213][211][197][210] [199][210][207][213][208] ([194][213][199])"
1120 print " [197]ntire contents of this magazine are"
1130 print " (c) 1986 by the [193]uthors within."
1140 if lk then sc=0: goto 5000
1150 print " [211]trike [211][208][193][195][197] to exit the cover page."
1160 if peek(2)<>2 then m$="([201]t's now loading...)": gosub 5200: print
1170 m$="[208]lease [211]tand [194]y..."
1180 goto 5100
1190 :
1999 rem display picture
2000 if lk=2 goto 2040
2010 poke 53280, kf: sys ml
2020 :
2030 rem wait for a key press
2040 poke 198, 0: wait 198, 1
2050 poke 53265, peek(53265) and 223
2060 poke 53270, peek(53270) and 239
2070 poke 53272, (peek(53272) and 240) or 4
2080 poke 53280, bb: poke 53281, bb: poke 646, ch
2081 print "[147][146]": return
2090 :
2100 rem monthly issue screen
2110 print "[147][146]";
2120 m$=mt$: gosub 5200
2130 print: print: m$=mo$: gosub 5200
2140 sc=0
2150 :
2160 return
2170 :
2999 rem get a function key
3000 cp=sc
3010 get k$: if k$<"[133]" or k$>"[140]" goto 3010
3020 on asc(k$)-132 gosub 3100, 3300, 3500, 3700, 3200, 3030, 3030, 3800
3030 return
3040 :
3100 sc=1: gosub 4000: goto 10
3110 :
3200 goto 1000
3210 :
3300 m$="[211][195][210][197][197][206] " + str$(cp)+ " [197]nter [208]age # ?[157]": gosub 5100
3310 gosub 6000: if sc=0 goto 2000
3320 gosub 4000: goto 10
3330 :
3500 sc=cp-1: gosub 4000: if sc=0 goto 2000
3510 goto 10
3520 :
3700 sc=cp+1: gosub 4000: goto 10
3710 :
3800 close 15: poke55, 0: poke 56, 160: clr: end
3810 :
3999 rem set page parameters
4000 if sc>pg then sc=pg
4010 if sc<1 then sc=0: goto 4030
4020 fl=(sc-1)*lp + 2: ll=sc*lp + 1
4022 if e=0 goto 4030
4024 of=0: if sc<cp then of=-1
4026 ps=0: for i=1 to e: if p(i)+of=sc then ps=i
4027 next
4028 if ps then gosub 4501
4030 return
4040 :
4499 rem load/view extra pics
4501 if ps=pl goto 4601
4521 pl=ps: t$=t$(ps): kf=c(ps)
4531 poke 2, 2 + 2*(t$="k") + (t$="d")
4551 open 1, 8, 8, f$(ps)
4561 poke 780, 1: poke 781, 8: poke 782, 0: sys 65466
4571 poke 780, 0: poke 781, 0: poke 782, 96 + 4*(t$="d"): sys 65493
4581 close 1
4601 goto 2000
4999 rem normal screen prompt
5000 sc$=str$(sc)
5010 m$="[208]ress 'f2' for [200][197][204][208] -- [211][195][210][197][197][206] " + sc$
5020 :
5099 rem message on last screen line
5100 print cd$; ""; sp$; cd$;
5110 :
5199 rem center a message
5200 print spc((40-len(m$))/2); m$;
5210 return
5220 :
5999 rem input up to 4 digits
6000 sc$="": k=0
6010 get k$: if k$="" goto 6010
6020 if k$=chr$(13) and k>0 then print k$: goto 6080
6030 if k$=chr$(20) and k>0 then k=k-1: sc$=left$(sc$,k): print k$;
6040 if k=4 then print: goto 6080
6050 if k$<"0" or k$>"9" goto 6010
6060 sc$=sc$+k$: k=k+1: print k$;
6070 goto 6010
6080 sc=val(sc$): return
6090 :
6999 rem bkgd, char colors
7000 data 1, 14
7010 :
7099 rem pic name, type, border color
7100 data "may 86 bug", "k", 14
7110 :
7119 rem # extra pics
7121 data 5
7149 rem page, name, type, border
7151 data 3, "pic j flags", "k", 12
7152 data 8, "lady", "d", 13
7153 data 12, "blue jays", "k", 6
7154 data 18, "middle earth", "d", 1
7155 data 24, "pic o amiga", "k", 7
7156 :
7199 rem issue file name
7200 data "demo"
7210 :
7299 rem mag title, issue month
7300 data "[193] [196][197][205][207] [206]ewsletter", "[202]uly 1986"
7310 :
7999 rem read & store ml
8000 ck=0: for i=ad to ad+41: read da: poke i,da: ck=ck+da: next
8010 if ck<>6121 then print "error in data": stop
8020 :
8030 ck=0: for i=ml to ml+127: read da: poke i,da: ck=ck+da: next
8040 if ck<>17262 then print "error in data": stop
8050 :
8060 return
8070 :
8080 rem c64 string thing data (file 2)
8090 data 160,2,177,45,153,137,0,200,192,6,208,246,162,2
8100 data 32,198,255,32,228,255,201,13,240,15,164,142,145,140
8110 data 200,132,142,196,139,240,4,165,144,240,234,76,204,255
8120 :
8130 rem ml data for mag display
8140 data 173,17,208,41,239,141,17,208,164,2,208,43,169,40,133,251
8150 data 162,131,134,252,162,4,169,216,160,0,32,109,192,173,22,208
8160 data 41,191,9,16,141,22,208,173,16,135,141,33,208,169,64,133
8170 data 251,162,127,134,252,208,8,169,0,133,251,162,92,134,252,169
8180 data 4,170,160,0,32,109,192,132,251,162,96,134,252,162,32,169
8190 data 32,32,109,192,173,17,208,9,34,141,17,208,173,24,208,9
8200 data 8,141,24,208,173,17,208,9,16,141,17,208,96,132,253,133
8210 data 254,177,251,145,253,200,208,249,230,252,230,254,202,208,242,96